<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div{
      width: 200px;
      height: 200px;
      background: #cef;
    }
  </style>
</head>
<body>
  <div></div>
  <script>
    //定时器
    // let i = 0;

    // setInterval(() => {
    //   console.log(i++);
    // }, 1000);

    //数组方法
    // let arr = [1,2,3,4,5];
    // let result = arr.map(item => item * 10);
    // let result2 = arr.filter(item => item % 2 === 1);
    // let result3 = arr.reduce((prev, cur) => prev + cur);
    
    //事件回调  这里不合适
    // let div = document.querySelector('div');

    // div.onclick = () => {
    //   this.style.background = '#f56';
    // }

    // div.addEventListener('click', () => {
    //   this.style.background = '#f56';
    // });
  </script>
</body>
</html>